表格组件中如何实现指定一列的宽度,内容自动换行?
问题描述
表格中指定一列的宽度,内容按照宽度限制自动换行,单元格的高度由实际内容行数决定。如何实现这个效果?

解决方案
表格配置中加入以下配置:
heightMode: 'autoHeight', // 高度模式:自动高度(每一行的高度由内容撑开)
autoWrapText: true, // 打开自动折行配置
代码示例
const option: TYPES.ListTableConstructorOptions = {
records,
columns,
heightMode: 'autoHeight',
autoWrapText: true
};
结果展示
